<?xml version="1.0"?>
<jsp:root 	xmlns:jsp="http://java.sun.com/JSP/Page"
 			xmlns:c="http://java.sun.com/jsp/jstl/core"
 			xmlns="http://www.w3.org/1999/xhtml"
 			version="2.1">
 
 <jsp:directive.page contentType="text/html" pageEncoding="UTF-8" />
 <jsp:directive.page isELIgnored="false" />
 <jsp:output 	omit-xml-declaration="false" 
 			 	doctype-root-element="HTML" 
 				doctype-system="about:legacy-compat" />
 
 <jsp:useBean id="datosLogin" class="es.javamyadmin.beans.LoginBean" scope="session" />
 <jsp:useBean id="listaTriggerBean" class="es.javamyadmin.beans.ListaTriggersBean" scope="session" />
 <jsp:useBean id="listaTablesBean" class="es.javamyadmin.beans.ListaTablesBean" scope="session" />
 
 <jsp:setProperty property="user" name="listaTriggerBean" value="${datosLogin.usuario}" />
 <jsp:setProperty property="pass" name="listaTriggerBean" value="${datosLogin.password}" />
 <jsp:setProperty property="host" name="listaTriggerBean" value="${datosLogin.servidor}" />
 <jsp:setProperty property="port" name="listaTriggerBean" value="${datosLogin.puerto}" />
 <jsp:setProperty property="database" name="listaTriggerBean" value="${listaTablesBean.database}" />

<html>
<head>

<link rel="icon" href="${pageContext.request.contextPath}/images/icons/favicon.png" type="image/x-icon"/>
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/icons/favicon.png" type="image/x-icon" />

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/reset.css" media="screen" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/java-admin.css" media="screen" />

<script src="${pageContext.request.contextPath}/js/showTables.js"><!-- A --></script>
<script src="${pageContext.request.contextPath}/js/jquery.js"><!-- N --></script>
<script src="${pageContext.request.contextPath}/js/bootstrap-transition.js"><!-- N --></script>
<script src="${pageContext.request.contextPath}/js/bootstrap-modal.js"><!-- N --></script>
<script src="${pageContext.request.contextPath}/js/ajaxCargarMsjConfirmacion.js"><!-- N --></script>

<title>JavaMyAdmin</title>

<script>
	$(document).ready(function() {
		$('#windowTitleDialog').bind('show', function () {
			
		});
	});
	function closeDialog () {
		$('#windowTitleDialog').modal('hide'); 
	};
	function okClicked () {
		closeDialog ();
	};	
</script>

</head>

<body onload="init('${listaTablesBean.user}','${listaTablesBean.pass}','${listaTablesBean.host}','${listaTablesBean.port}','${listaTablesBean.database}')">

<div id="wrapper">
<div id="todo">

<div id="contenedor">
	
	<jsp:include page="../includes/sidebar-left.jsp" />
	
	<div id="contenido">
	
		<jsp:include page="../includes/cabecera.jsp" />
		
		<h2>Base de Datos: <c:out value="${listaTablesBean.database}"></c:out></h2>
		
		<jsp:include page="../includes/menu-superior-alternativo.jsp" />
		
		<!-- Errores -->
		<c:if test="${error!=null}"><div id="ko"  class="aviso"><div class="pro_aviso ko"><p>${error }<c:if test="${descripcion != null}"><a id="especial" data-toggle="modal" href="#windowTitleDialog" onclick="cargarDatosMsj('6', '${descripcion}', '');" style="font-size:'10px'; "> (más)</a></c:if></p></div></div></c:if>
		<c:if test="${ok!=null}"><div class="aviso"><div class="pro_aviso ok"><p><c:out value="${ok}"></c:out></p></div></div></c:if>
		
		<!-- VENTANA EMERGENTE DE CONFIRMACIÓN -->
		<div id="windowTitleDialog" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="windowTitleLabel" aria-hidden="true">
			<!-- se cargará el mensaje por ajax -->
		</div>
		
		
		<form action="${pageContext.request.contextPath}/createTrigger" method="post">
			<input type="hidden" name="user" value="${listaTablesBean.user}" />
			<input type="hidden" name="pass" value="${listaTablesBean.pass}" />
			<input type="hidden" name="host" value="${listaTablesBean.host}" />
			<input type="hidden" name="port" value="${listaTablesBean.port}" />
			<input type="hidden" name="database" value="${listaTablesBean.database}" />
			
			<table id="lista-tablas">	
				<tr>
					<th style='border-radius: 5px 0 0 0;'>CAMPO</th>
					<th style='border-radius: 0 5px 0 0;'>VALOR</th>
					
				</tr>	
				<tr>
					<td align="center">Nombre</td>
					<td align="center"><input class="campo"  type="text" name="nombre" /></td>
				</tr>
				<tr>
					<td align="center">Tabla</td>
					<td align="center" id="select-tablas">
						<img height="20px" src="${pageContext.request.contextPath}/images/loading.gif"/>
					</td>
				</tr>
				<tr>
					<td align="center">Tiempo</td>
					<td align="center">
						<select class="campo"  name="tiempo">
							<option value="before">BEFORE</option>
							<option value="after">AFTER</option>
						</select>
					</td>
				</tr>
				<tr>
					<td align="center">Evento</td>
					<td align="center">
						<select class="campo" name="evento">
							<option value="insert">INSERT</option>
							<option value="update">UPDATE</option>
							<option value="delete">DELETE</option>
						</select>
					</td>
				</tr>
				<tr>
					<td align="center">Definicion</td>
					<td align="center"><textarea class="campo" name="definicion"><!-- A --></textarea></td>
				</tr>
				<!-- 
				<tr>
					<td align="center">Definidor</td>
					<td align="center"><input class="campo"  type="text" name="definidor" /></td>
				</tr>
				-->			
		 	</table>
		 	<input class="boton" type="submit" id="submit" name="crear" value="Crear" disabled="disabled" />
	 	</form>
	</div>

</div>

</div>
</div>
</body>
</html>
</jsp:root>
